﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using eschoolBO;

namespace ESCHOOL.students
{
    public partial class WebForm4 : System.Web.UI.Page
    {
        report re = new report();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                DataTable dt = re.GetRecords(-99, "", -99, Convert.ToInt64(Session["userid"]), -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, "", -99, false, " and ");

                DetailsView1.DataSource = dt;
                DetailsView1.DataBind();


                //GridView1.DataSource = dt;
                //GridView1.DataBind();
            }           
        }

        protected void ddexams_SelectedIndexChanged(object sender, EventArgs e)
        {
            //DataTable dt = re.GetRecords(-99,ddexams.SelectedValue.ToString(), -99, Convert.ToInt64(Session["userid"]), -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, "", -99, false, " and ");
            //GridView1.DataSource = dt;
            //GridView1.DataBind();
        }

        protected void ddexams_TextChanged(object sender, EventArgs e)
        {
            DataTable dt = re.GetRecords(-99, ddexams.SelectedValue.ToString(), -99, Convert.ToInt64(Session["userid"]), -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, "", -99, false, " and ");
            GridView1.DataSource = dt;
            GridView1.DataBind();
        }

        protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            GridView1.PageIndex = e.NewPageIndex;
            DataTable dt = re.GetRecords(-99, "", -99, Convert.ToInt64(Session["userid"]), -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, "", -99, false, " and ");
            GridView1.DataSource = dt;
            GridView1.DataBind();
        }
    }
}
